function HighlightNavBar() {
    var prefs = new gadgets.Prefs();
    var section = prefs.getString("site_section");
    if (section != "") {
	var nav = document.getElementById("nav_" + section);
	nav.className = "current";
    }
}

function DisplayUserState() {
    if (user_info.user_email) {
	document.getElementById('user_signed_in').className = "authentication";
	document.getElementById('user_name').innerHTML = user_info.user_email;
	document.getElementById('user_sign_out').href = user_info.logout_url;
    } else {
	document.getElementById('user_no_user').className = "authentication";
    }
}

function LoginPopup(source) {
    var source_element = document.getElementById(source);
    if (source_element) source_element.blur();
    window.open(user_info.logout_url, 'rec_login', 'width=750, height=350, scrollbars=1');
}
